<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <title>Title</title>

    <%@include file="/static/common/common.jsp"%>

    <script src="/static/js/employee.js"></script>

</head>
<body>
    <table id="emp_datagrid"></table>

<div id="emp_toolbar">
    <%--<shiro:hasPermission name="employee:saveOrUpdate">--%>
        <a class="easyui-linkbutton" iconCls="icon-add" plain="true" data-cmd="add">新增</a>
        <a class="easyui-linkbutton" iconCls="icon-edit" plain="true" data-cmd="edit" >编辑</a>
<%--    </shiro:hasPermission>--%>
    <a id="state_btn" class="easyui-linkbutton" iconCls="icon-remove" plain="true"
       data-cmd="changeState" >离职</a>
    <input id="keyword" class="easyui-textbox" prompt="请输入用户名或电话" >
    <a class="easyui-linkbutton" iconCls="icon-search" plain="true"  data-cmd="query" >查询</a>
    <a class="easyui-linkbutton" iconCls="icon-cut" plain="true" <%-- data-cmd="exportXls"--%> onclick="window.open('/employee/exportXls.do')" >导出</a>

    <form action="/employee/importXls.do" method="post" enctype="multipart/form-data">
        <input type="file" name="file"/>
        <input type="submit" value="上传"/>
    </form>


</div>

<div id="form_btns">
     <a class="easyui-linkbutton" iconCls="icon-save" plain="true" data-cmd="save" >保存</a>
      <a class="easyui-linkbutton" iconCls="icon-cancel" plain="true" data-cmd="cancel" >取消</a>
</div>

<div id="emp_dialog">
    <form id="emp_form" method="post">
        <input type="hidden" name="id" id="empId" />
        <table align="center" style="margin-top: 15px">
            <tbody>
            <tr>
                <td>用户名:</td>
                <td><input  name="username" class="easyui-textbox"
                            invalidMessage="用户名已存在"
                            validType="remote['/employee/validateName.do?id='+empId.value,'username']"
                    <%-- data-options="validType:{remote:['/employee/validateName.do?id='+empId.value,'username']},invalidMessage:'用户名已存在'" --%>></td>
            </tr>
            <tr >
                <td>真实姓名:</td>
                <td><input  name="realname" class="easyui-textbox"  /></td>
            </tr>
            <tr id="tr_password">
                <td>密码:</td>
                <td><input id="password" name="password" class="easyui-passwordbox" required="true"  /></td>
            </tr>
            <tr>
                <td>邮箱:</td>
                <td><input  name="email" class="easyui-textbox" /></td>
            </tr>
            <tr>
                <td>电话:</td>
                <td><input  name="tel" class="easyui-textbox" /></td>
            </tr>
            <tr>
                <td>入职时间:</td>
                <td><input  name="hireDate" class="easyui-datebox" /></td>
            </tr>
            <tr>
                <td>部门:</td>
                <td><input  name="dept.id" class="easyui-combobox" data-options="url:'/dept/selectAll.do',valueField:'id',textField:'name',panelHeight:'auto'" /></td>
            </tr>
            <tr>
                <td>管理员:</td>
                <td><input  name="admin" class="easyui-combobox"
                        data-options="valueField:'value',textField:'text',panelHeight:'auto',
                        data:[{text:'是',value:'1'},{text:'否',value:'0'}]"/></td>
            </tr>
            <tr>
                <td>角色:</td>
                <td><input id="role_combobox" class="easyui-combobox"
                        data-options="multiple:true,valueField:'id',textField:'name',panelHeight:'auto',
                        url:'/role/selectAll.do'"/></td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
</body>
</html>
